function lazyload() {

    let scrollTop = window.innerHeight || document.documentElement.clientHeight  
    let viewport = document.documentElement.scrollTop || document.body.scrollTop  
    let showImgHeight = scrollTop + viewport

    let imgObj = document.querySelectorAll("img")

    imgObj.forEach(function (item) {
    if (item.offsetTop <= showImgHeight) item.src = item.getAttribute("data")
    })
}

